// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 此处后端没有提供注释 POST /api/v1/auth/authenticate */
export async function authenticate(
  body: API.AuthenticationRequest,
  options?: { [key: string]: any },
) {
  return request<API.RAuthenticationResponse>('/api/v1/auth/authenticate', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /api/v1/auth/currentUser */
export async function currentUser(options?: { [key: string]: any }) {
  return request<API.R>('/api/v1/auth/currentUser', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /api/v1/auth/refresh-token */
export async function refreshToken(options?: { [key: string]: any }) {
  return request<any>('/api/v1/auth/refresh-token', {
    method: 'POST',
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /api/v1/auth/register */
export async function register(body: API.RegisterRequest, options?: { [key: string]: any }) {
  return request<API.RAuthenticationResponse>('/api/v1/auth/register', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
